<?php
class Admin_Reports_Controller extends Admin_Controller {

	public $restful = true;

	public function __construct()
	{
		parent::__construct();
		//--Your Code --//
		$this->theme->set_theme("admin") ;
		$this->theme->set_layout("default");
		
		
	}


	public function get_enq(){
		
		
		$data['MODE'] = "ENQ";
		$data['reports'] = DB::table('report')->where('type','=','ENQ')->get();
		
		
		$this->theme->title("Enquiry Reports");
		return $this->theme->render('admin::reports',$data);
	}

	public function get_claim(){
	
	
		$data['MODE'] = "ENQ";
		$data['reports'] = DB::table('report')->where('type','=','CLAIM')->get();
	
	
		$this->theme->title("Claim Reports");
		return $this->theme->render('admin::reports',$data);
	}
	
	public function get_inc(){
	
	
		$data['MODE'] = "INC";
		$data['increports'] = DB::table('report')->where('type','=','INQ')->get();
	
	
		$this->theme->title("Reports Incorrect");
		return $this->theme->render('admin::reports',$data);
	}
	
	public function get_edit($id){
	
	$data['MODE'] = "VIEW";	
	$data['report'] = DB::table('report')->where('id','=',$id)->first();
	$this->theme->title("Edit Reports");
	return $this->theme->render('admin::reports',$data);
	}
	
	public function get_delete($id){
		
		DB::table('report')->where('id','=',$id)->delete();
		
		return Redirect::back();
		
	}
	
	public function get_subscribe(){
		
		
		$data['emails'] = DB::table('subscribe')->get();
		
		$this->theme->title("Subscribe Newsllerts");
		return $this->theme->render('admin::subscribe',$data);
		
	}
	
}